﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace NamedBinaryTag
{
	/// <summary>
	/// Helpers to define debug flags.
	/// </summary>
	public static class DebugFlags
	{
		/// <summary>
		/// The associated array of debug flags.
		/// </summary>
		private static Dictionary<int, bool> debugFlags;

		/// <summary>
		/// Initializes debug flags to no debug.
		/// </summary>
		static DebugFlags()
		{
			debugFlags = new Dictionary<int, bool>();
		}

		/// <summary>
		/// Defines the value of a debug flag.
		/// </summary>
		/// <param name="id">The flag id.</param>
		/// <param name="value">The new value for the flag.</param>
		public static void SetDebug(int id, bool value)
		{
			debugFlags[id] = value;
		}

		/// <summary>
		/// Obtains the value of a debug flag.
		/// </summary>
		/// <param name="id">The flag id.</param>
		/// <returns>The flag value.</returns>
		public static bool GetDebug(int id)
		{
			return debugFlags.ContainsKey(id) ? debugFlags[id] : false;
		}
	}
}
